package com.gofun.framework.web;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.gofun.framework.web.interceptor.PageInterceptor;
import com.gofun.framework.web.interceptor.ResponseInterceptor;


@Configuration
public class WebAppConfigurer extends WebMvcConfigurerAdapter {
	
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(new PageInterceptor()).addPathPatterns("/**");
		registry.addInterceptor(new ResponseInterceptor()).addPathPatterns("/**");
//		registry.addInterceptor(new JWTInterceptor()).addPathPatterns("/user/**");
		super.addInterceptors(registry);
	}
	
	@Override
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
		/*registry.addResourceHandler("/mystatic/**")
				.addResourceLocations("classpath:/mystatic/");*/
		super.addResourceHandlers(registry);
	}

}
